package com.hg.junit.api;

import org.junit.Test;

import static org.junit.Assert.*;

//测试的有用的声明方法 只有失败的声明方法才会被记录
public class MyAssert {

    String message = "Hello World";
    MyService service = new MyService(message);

    @Test
    public void test1() {
        assertEquals(message, service.printMessage());
    }

    @Test
    public void test2() {
        assertFalse(message.equals("abc"));
    }

    @Test
    public void test3() {
        String s = new String();
        assertNotNull(s);
    }

    @Test
    public void test4() {
        assertNull(null);
    }

    @Test
    public void test5() {
        assertTrue(true);
    }

    @Test
    public void test6() {
        String a = new String("abc");
        String b = new String("abc");
        assertEquals(a, b);
        //故意出错
//        fail();
    }


}
